import { defHttp } from '/@/utils/http/axios';
enum Api {
	url = 'Users',
	enabled = 'Users/Enabled',
	deenabled = 'Users/Disabled',

}

export function list(params) {
	return defHttp.get({ url: Api.url, params });
}
export function add(data: any) {
	return defHttp.post({ url: Api.url, data });
}
export function enabled(data: any) {
	return defHttp.put({ url: Api.enabled, data });
}
export function deenabled(data: any) {
	return defHttp.put({ url: Api.deenabled, data });
}
export function edit(id: string, data: any) {
	return defHttp.put({ url: Api.url + '/' + id, data });
}
export function del(id: string | string[]) {
	if (!Array.isArray(id)) {
		id = [id]
	}
	return defHttp.delete({ url: Api.url, data: id });
}
export function info(id: string) {
	return defHttp.get({ url: Api.url + '/' + id });
}
export function changePassword(id: string, data) {
	return defHttp.put({ url: `Users/${id}/Password/Change`, data: data.password });
}